CC     = g++
OPT    = -O3
DEBUG  = -g
OTHER  = -Wno-deprecated -fpermissive
#CFLAGS = $(OPT) $(OTHER)
CFLAGS = $(DEBUG) $(OTHER)

MODULE = run
SRCS = top.cpp simple_bus.cpp simple_bus_tools.cpp simple_bus_arbiter.cpp simple_bus_types.cpp control.cpp button.cpp
OBJS = $(SRCS:.cpp=.o)

all: run.x 

simple_bus.o: simple_bus_blocking_if.h simple_bus_non_blocking_if.h simple_bus_fast_mem.h simple_bus_request.h simple_bus_slave_if.h simple_bus.h simple_bus.cpp simple_bus_arbiter.h simple_bus_arbiter_if.h simple_bus_arbiter.cpp simple_bus_types.h simple_bus_types.h simple_bus_tools.cpp

button.o: if.h button.h button.cpp

control.o: if.h control.h control.cpp

top.o: if.h button.h control.h simple_bus.h top.cpp

ifneq (, $(realpath $(HOME)/systemc/Makefile.defs))
include ~/systemc/Makefile.defs
else ifneq (, $(realpath ../Makefile.defs))
include ../Makefile.defs
#else
#$(error "Cannot find Makefile.defs")
endif
